const fs = require('fs').promises
const path = require('path')

const fileHelper = {
    readFile: (path) => {
        return fs.readFile(path, { encoding: 'utf8' })
    },
    writeFile: (path, content) => {
        return fs.writeFile(path, content, { encoding: 'utf8' })
    }
}
// const testPath = path.join(__dirname,'SubscribeMsg.js')
// fileHelper.readFile(testPath).then((data)=>{
//     console.log(data)
// })
// const testwrite = path.join(__dirname,'hello.json')
// fileHelper.writeFile(testwrite,'{ok:ok}').then(()=>{
//     console.log('ok')
// })
module.exports =fileHelper
// 原文链接：https://blog.csdn.net/qq_34273059/article/details/103958395